<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="../css/base.css" rel="stylesheet" type="text/css">
    <link href="../css/style.css" rel="stylesheet" type="text/css">
    <script type="text/javascript" src="../js/jquery-1.11.3.min.js"></script>
    <script type="text/javascript" src="../js/paramsTool.js"></script>
    <script src="../js/layer.js"></script>
    <title>渠道管理</title>
</head>
<style type="text/css">
    .swiper-container {width: 100%; height: 100%; margin: 0 auto;  position: relative;  overflow: hidden;  z-index: 1; }

    .swiper-container ul li {
        width: 29%;
        float: left;
        border: 1px solid #dcdcdc;
        margin:20px 0 0px 10px;
        text-align: center;
        height: 50px;
        padding: 18px 0;
        color: #888888;
        font-size: 18px;
    }

    .swiper-container ul li span {
        font-size: 17px;
        color: #444;
        font-weight: 500;
    }

    .phtact {
        background-color: #ea4821;
        color: #fff !important;
    }
    .phtact span{
        color: yellow !important;
    }

    .btnClass{
        margin: 20px auto;
        width: 95%;
        height: 50px;
        line-height: 50px;
        text-align: center;
        background-color: #ea4821;
        font-size: 20px;
        color: #FFF;
        border-radius: 5px;
    }
</style>
<script type="text/javascript">
    var host = window.location.origin;
    var channel= 'popularize1';
    var openid =  getCookie('wxopenid');
    var coin = getCookie('coin');

    if(!openid || !coin){
//        getWxCode();
    }
    $(function(){

        $("#recharge li").click(function() {

            $(this).siblings('li').removeClass('phtact');  // 删除其他兄弟元素的样式

            $(this).addClass('phtact');                    // 添加当前元素的样式

            channel = $(".phtact").data('postid');
        });

        $(".btnClass").click(function(){
            openid =  getCookie('wxopenid');// || 'o4AyEt2gypi_z981XBQzM5in0q_U';

//            if(openid != 'o4AyEt_EpmY83VE17bCOJ-t8MIEg' && openid != 'o4AyEt2gypi_z981XBQzM5in0q_U'){
            if(true){
                alert('暂不开启!!!')
            }else {
                layer.open({
                    content: '确定结算'+channel+'渠道?'
                    , btn: ['确定','取消']
                    , yes: function (index) {
                        layer.close(index);
                        $.ajax({
                            url: host + "/balanceChannel",
                            type: "get",
                            dataType: 'json',
                            async: true,//请求是否异步，默认为异步，这也是ajax重要特性
                            headers: {"content-type": "application/json", "openid": openid,"channel": channel},
                            success: function (data) {
                                if (data.code) {
                                    layer.open({
                                        content: data.info
                                        , skin: 'msg'
                                        , time: 1.5 //2秒后自动关闭
                                    });
                                } else {
                                    data = data.data;
                                    layer.open({
                                        content: channel+'渠道已结算成功! <br>充值订单结算:'+data.orderChange+'条; 提现订单结算'+data.cashChange+'条;'
                                        , btn: ['确定']
                                        , yes: function (index) {
                                            layer.close(index);
                                        }
                                    });
                                }

                            },
                            error: function () {
                                layer.open({
                                    content: '结算失败,请重试!'
                                    , skin: 'msg'
                                    , time: 1.5 //2秒后自动关闭
                                });
                            }
                        });
                    }
                });
            }
        });

    });


</script>
<body>
<div class="swiper-container">

    <ul id="recharge">
        <li data-postid="popularize1" class="phtact">
            <span>popularize1</span><br>渠道结算
        </li>
        <li data-postid="popularize2">
            <span>popularize2</span><br>渠道结算
        </li>
        <li data-postid="popularize3">
            <span>popularize3</span><br>渠道结算
        </li>
        <li data-postid="popularize4">
            <span>popularize4</span><br>渠道结算
        </li>
        <li data-postid="popularize5">
            <span>popularize5</span><br>渠道结算
        </li>
        <li data-postid="popularize6">
            <span>popularize6</span><br>渠道结算
        </li>
        <li data-postid="popularize7">
            <span>popularize7</span><br>渠道结算
        </li>
        <li data-postid="popularize8">
            <span>popularize8</span><br>渠道结算
        </li>
        <li data-postid="popularize9">
            <span>popularize9</span><br>渠道结算
        </li>
        <li data-postid="popularize10">
            <span>popularize10</span><br>渠道结算
        </li>
        <li data-postid="popularize11">
            <span>popularize11</span><br>渠道结算
        </li>
        <li data-postid="popularize12">
            <span>popularize12</span><br>渠道结算
        </li>
    </ul>
</div>

<div class="btnClass">渠道结算</div>

<!--底部导航-->
<div class="spring_bar">
    <a href="minWheel.html">
        <dl class="list">
            <dt class=""><img src="../image/ctb1on.png" /></dt>
            <dd>幸运转盘</dd>
        </dl>
    </a>
    <a href="shareCode.html">
        <dl class="list">
            <dt><img src="../image/ctb2.png" /></dt>
            <dd>推广二维码</dd>
        </dl>
    </a><a href="postCash.html">
    <dl class="list">
        <dt><img src="../image/ctbm.png" /></dt>
        <dd></dd>
    </dl>
</a><a href="recharge.html">
    <dl class="list">
        <dt>
            <img src="../image/ctb3.png" />
        </dt>
        <dd>
            充值中心
        </dd>
    </dl> </a>
    <a href="me.html">
        <dl class="list">
            <dt><img src="../image/ctb4.png" /></dt>
            <dd>个人中心</dd>
        </dl>
    </a>
</div>
<!--底部导航end-->

</body>
</html>